package equipmentBusiness;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * Created by yangxianming on 2018/1/11.
 */
public class EquipmentExcelModel {
    private HashMap<Integer, ArrayList<String>> hashMap = new HashMap<Integer,  ArrayList<String>>();

    public boolean saveExcel(String path){
        setTestData();
        OptionExcel optionExcel = new OptionExcel(path);
        return optionExcel.optionExcel(fileName, hashMap);
    }

    //注意！！！如果模板出来后，调换setTestData中的put顺序或者直接注释和增加即可
    private void setTestData(){
        int s = 0;
        hashMap.put(s++, community);
        hashMap.put(s++, equipmentName);
        hashMap.put(s++, equipmentNumber);
        hashMap.put(s++, equipmentInstallSpace);
        hashMap.put(s++, equipmentStatus);
//        hashMap.put(s++, equipmentPrimary);
        hashMap.put(s++, equipmentTwoStage);
        hashMap.put(s++, equipmentIsInstallRoom);
        hashMap.put(s++, equipmentInstallRoomName);
        hashMap.put(s++, isMaintenance);
//        hashMap.put(s++, maintenanceWay);
        hashMap.put(s++, maintenanceContractStart);
        hashMap.put(s++, maintenanceContractEnd);
        hashMap.put(s++, maintenanceFirstTime);
        hashMap.put(s++, maintenanceCycles);
        hashMap.put(s++, maintenanceCompany);
        hashMap.put(s++, maintenanceContact);
        hashMap.put(s++, maintenancePhone);
        hashMap.put(s++, maintenanceContent);
        hashMap.put(s++, isPatrol);
//        hashMap.put(s++, patrolWay);
        hashMap.put(s++, patrolFirstTime);
        hashMap.put(s++, patrolCycles);
        hashMap.put(s++, equipmentContact);
        hashMap.put(s++, equipmentPhone);
//        hashMap.put(s++, equipmentDateOfProduction);
//        hashMap.put(s++, equipmentDateOfInstal);
//        hashMap.put(s++, equipmentDeliveryDate);
//        hashMap.put(s++, equipmentStartDate);
        hashMap.put(s++, equipmentAnnualInspactionDate);
        hashMap.put(s++, equipmentShelfLifeEndDate);
//        hashMap.put(s++, equipmentProductionNo);
//        hashMap.put(s++, equipmentType);
//        hashMap.put(s++, equipmentManufacturer);
//        hashMap.put(s++, equipmentSupplier);
//        hashMap.put(s++, equipmentVoltage);
//        hashMap.put(s++, equipmentCurrent);
//        hashMap.put(s++, equipmentPower);
//        hashMap.put(s++, equipmentHertz);
        hashMap.put(s++, equipmentMark);
    }

    public String fileName;
    public ArrayList<String> community = new ArrayList<String>(){{add("*所属小区");}};                       //所属小区
    public ArrayList<String> equipmentName = new ArrayList<String>(){{add("*设备名称");}};                   //设备名称
    public ArrayList<String> equipmentNumber = new ArrayList<String>(){{add("*设备编号");}};                 //设备编号
    public ArrayList<String> equipmentInstallSpace = new ArrayList<String>(){{add("*安装位置");}};           //安装位置
    public ArrayList<String> equipmentStatus = new ArrayList<String>(){{add("*设备状态");}};                 //设备状态
    public ArrayList<String> equipmentPrimary = new ArrayList<String>(){{add("*设备一级分类");}};                //设备一级分类
    public ArrayList<String> equipmentTwoStage = new ArrayList<String>(){{add("*设备二级分类");}};               //设备二级分类
    public ArrayList<String> equipmentIsInstallRoom = new ArrayList<String>(){{add("*是否安装在设备房");}};          //是否安装在设备房
    public ArrayList<String> equipmentInstallRoomName = new ArrayList<String>(){{add("*所属设备房");}};        //属于哪个设备房
    public ArrayList<String> isMaintenance = new ArrayList<String>(){{add("*是否维保");}};                   //是否维保
    public ArrayList<String> maintenanceWay = new ArrayList<String>(){{add("*维保方式");}};                  //维保方式
    public ArrayList<String> maintenanceContractStart = new ArrayList<String>(){{add("*维保合同开始时间");}};        //维保合同开始时间
    public ArrayList<String> maintenanceContractEnd = new ArrayList<String>(){{add("*维保合同结束时间");}};          //维保合同结束时间
    public ArrayList<String> maintenanceFirstTime = new ArrayList<String>(){{add("*首次维保日期");}};            //首次维保日子
    public ArrayList<String> maintenanceCycles = new ArrayList<String>(){{add("*维保周期");}};               //维保周期
    public ArrayList<String> maintenanceCompany = new ArrayList<String>(){{add("维保公司");}};              //维保公司
    public ArrayList<String> maintenanceContact = new ArrayList<String>(){{add("维保公司联系人");}};              //维保公司联系人
    public ArrayList<String> maintenancePhone = new ArrayList<String>(){{add("维保公司联系电话");}};                //维保公司联系电话
    public ArrayList<String> maintenanceContent = new ArrayList<String>(){{add("维保内容");}};              //维保内容
    public ArrayList<String> isPatrol = new ArrayList<String>(){{add("*是否巡检");}};                        //是否巡检
    public ArrayList<String> patrolWay = new ArrayList<String>(){{add("*巡检方式");}};                       //巡检方式
    public ArrayList<String> patrolFirstTime = new ArrayList<String>(){{add("*首次巡检日期");}};                 //首次巡查日期
    public ArrayList<String> patrolCycles = new ArrayList<String>(){{add("*巡检周期");}};                    //巡查周期
    public ArrayList<String> equipmentContact = new ArrayList<String>(){{add("责任人");}};                   //责任人
    public ArrayList<String> equipmentPhone = new ArrayList<String>(){{add("责任人手机");}};                   //责任人手机
    public ArrayList<String> equipmentDateOfProduction = new ArrayList<String>(){{add("出厂日期");}};       //出厂日期
    public ArrayList<String> equipmentDateOfInstal = new ArrayList<String>(){{add("安装日期");}};           //安装日期
    public ArrayList<String> equipmentDeliveryDate = new ArrayList<String>(){{add("交付日期");}};           //交付日期
    public ArrayList<String> equipmentStartDate = new ArrayList<String>(){{add("启用日期");}};              //设备启用日期
    public ArrayList<String> equipmentAnnualInspactionDate = new ArrayList<String>(){{add("年检日期");}};   //年间日期
    public ArrayList<String> equipmentShelfLifeEndDate = new ArrayList<String>(){{add("质保结束日期");}};       //设备质保结束时间
    public ArrayList<String> equipmentProductionNo = new ArrayList<String>(){{add("出厂编号");}};           //出厂编号
    public ArrayList<String> equipmentType = new ArrayList<String>(){{add("设备型号");}};                   //设备型号
    public ArrayList<String> equipmentManufacturer = new ArrayList<String>(){{add("制造商");}};           //设备制造商
    public ArrayList<String> equipmentSupplier = new ArrayList<String>(){{add("供应商");}};               //供应商
    public ArrayList<String> equipmentVoltage = new ArrayList<String>(){{add("额定电压（伏）");}};                //设备电压
    public ArrayList<String> equipmentCurrent = new ArrayList<String>(){{add("额定电流（安培）");}};                //设备电流
    public ArrayList<String> equipmentPower = new ArrayList<String>(){{add("功率（瓦）");}};                  //设备功率
    public ArrayList<String> equipmentHertz = new ArrayList<String>(){{add("频率");}};                  //设备频率
    public ArrayList<String> equipmentMark = new ArrayList<String>(){{add("备注");}};                   //备注

}
